package com.deyuanyun.pic.pbf.controller.dto.defect.repair;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.util.format.NumberFormat;
import com.deyuanyun.pic.pbf.domain.RepairABTypeSleeve;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;

/**
 * 3,A，B型套筒补强修复表
 *
 * @author huanglw
 * @date 2016-6-27
 *
 * History: [修改人][时间][修改描述]
 */
public class RepairABTypeSleeveDto extends RepairDto {

    /**
     * 套筒信息-套筒尺寸-壁厚（mm）
     */
    private String wallThickness;

    /**
     * 套筒信息-套筒尺寸-长度（mm）
     */
    private String length;

    /**
     * 套筒信息-材质
     */
    private String material;

    /**
     * 环境温度（℃）
     */
    private String environmentalTemperature;

    /**
     * 管表温度（℃）
     */
    private String surfaceTemperature;

    /**
     * 焊材牌号
     */
    private String weldingGrade;

    /**
     * 焊接方法
     */
    private String weldingMethod;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public RepairABTypeSleeveDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }


    public String getWallThickness() {
        return wallThickness;
    }

    public void setWallThickness(String wallThickness) {
        this.wallThickness = wallThickness;
    }

    public String getLength() {
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }

    public String getMaterial() {
        return material;
    }

    public void setMaterial(String material) {
        this.material = material;
    }

    public String getEnvironmentalTemperature() {
        return environmentalTemperature;
    }

    public void setEnvironmentalTemperature(String environmentalTemperature) {
        this.environmentalTemperature = environmentalTemperature;
    }

    public String getSurfaceTemperature() {
        return surfaceTemperature;
    }

    public void setSurfaceTemperature(String surfaceTemperature) {
        this.surfaceTemperature = surfaceTemperature;
    }

    public String getWeldingGrade() {
        return weldingGrade;
    }

    public void setWeldingGrade(String weldingGrade) {
        this.weldingGrade = weldingGrade;
    }

    public String getWeldingMethod() {
        return weldingMethod;
    }

    public void setWeldingMethod(String weldingMethod) {
        this.weldingMethod = weldingMethod;
    }

    public void fromDomain(RepairABTypeSleeve domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 套筒信息-套筒尺寸-壁厚（mm）
        this.wallThickness = NumberFormat.format(domain.getWallThickness());
        // 套筒信息-套筒尺寸-长度（mm）
        this.length = NumberFormat.format(domain.getLength());
        // 材质
        this.material = CodeUtil.getName(domain.getMaterial());
        // 环境温度（℃）
        this.environmentalTemperature = NumberFormat.format(domain.getEnvironmentalTemperature());
        // 管表温度（℃）
        this.surfaceTemperature = NumberFormat.format(domain.getSurfaceTemperature());
        // 焊材牌号
        this.weldingGrade = domain.getWeldingGrade();
        // 焊接方法
        this.weldingMethod = domain.getWeldingMethod();

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}